package main

import (
	"goruntimeCrawler/engine"
	"goruntimeCrawler/persist"
	"goruntimeCrawler/scheduler"
	"goruntimeCrawler/zhenai/parser"
)

var url="http://www.zhenai.com/zhenghun"
//var url="http://m.zhenai.com/zhenghun/aba"
//var url="http://m.zhenai.com/u/110538321#seo"

func main() {
	//将请求 和 执行单元 放到队列中进行执行
	e:=engine.ConcurrentEngine{
		  Scheduler:&scheduler.QueuedScheduler{},
	      WorkerCount:100,
		  ItemChan:persist.ItemSaver(),
	}

	//多个执行单元抢一个request
	//e:=engine.ConcurrentEngine{
	//	Scheduler:&scheduler.SimpleScheduler{},
	//    WorkerCount:100,
	//}
	e.Run(
		  engine.Request{
		  	UrL:url,
		  	ParserFunc:parser.PaseCityList,
		  },
		)
}